#include "opponent.h"

Opponent::Opponent(Renderer *rend) : Fighter(20,100,20)
{
	rnd = rend;
	image = rnd->loadImage("Images//FighterJetRed128.png");
		if (image==NULL) {
			throw "Failed to load image";
		} else {
			texId = rnd->createTexture(image);
		}

	position.w = image->w;
	position.h = image->h;
	position.x = RES_WIDTH-position.w*2;
	position.y = RES_HEIGHT-position.h*2;
	angle = 0.0f;

	clientNum = -1;
	setHP(0);

	defaultLaserImagePath = "Images//laser1.png";

	drawPos->w=image->w;
	drawPos->h=image->h;
}
Opponent::~Opponent()
{
}
bool Opponent::action(int type)
{
	switch(type)
	{
	case -2:
		return getNormalAttack()->fire();
		break;
	case -3:
		return getWideAttack()->fire();
		break;
	case -4:
		return getSpecialAttack()->fire();
		break;
	default:
		return false;
		break;
	}
}
